/*
 * ServiceAndFeedbackActivity.java
 * business
 *
 * Created by chentao on 2017/5/10.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.service;

import android.app.Activity;
import android.content.Intent;

import com.yidiandao.business.R;
import com.yidiandao.business.base.BaseActivity;
import com.yidiandao.business.utils.ActivityUtils;

/** 服务与反馈 */
public class ServiceActivity extends BaseActivity {

    private ServiceFragment mServiceFragment;

    public static void actionStart(Activity activity) {
        Intent intent = new Intent(activity, ServiceActivity.class);
        activity.startActivity(intent);
    }

    @Override
    protected void initFragment() {
        mServiceFragment =
                (ServiceFragment)
                        getSupportFragmentManager()
                                .findFragmentById(R.id.container_service);
        if (mServiceFragment == null) {
            mServiceFragment = ServiceFragment.getInstance();
            ActivityUtils.addFragmentToActivity(
                    getSupportFragmentManager(),
                    mServiceFragment,
                    R.id.container_service);
        }
    }

    @Override
    protected void initPresenter() {
        new ServicePresenter(mServiceFragment);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_service;
    }
}
